package com.bw.mine

import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import com.blankj.utilcode.util.SPUtils
import com.bw.common.mvvm.BaseViewFragment
import com.bw.mine.databinding.FragmentMineBinding
import com.therouter.TheRouter

class MineFragment : BaseViewFragment<FragmentMineBinding>() {
    val roleid = SPUtils.getInstance().getInt("roleid", 0)

    override fun initData() {

    }

    @RequiresApi(Build.VERSION_CODES.Q)
    override fun initView() {
        Log.d("TAG", "initView: ${roleid}")
        binding.topLayout.name.text = "张丽娜"
        binding.topLayout.address.text = "金融科技大厦  B座"
        if (roleid == 19){
            binding.fk.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.fillet_wdsq,0,0)
            binding.fk.text = "我的申请"
            binding.wy.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.fillet_wdsh,0,0)
            binding.wy.text = "我的审核"
            binding.sq.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.fillet_wdgg,0,0)
            binding.sq.text = "我的公告"
            binding.ss.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.fillet_rygl,0,0)
            binding.ss.text = "人员管理"
            binding.sh.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.fillet_fkgl,0,0)
            binding.sh.text = "访客管理"
            binding.key.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.fillet_wyfw,0,0)
            binding.key.text = "物业服务"

        }
        binding.wy.setOnClickListener {
            if (roleid == 19){
                TheRouter.build("/mine/WyActivity").navigation()
            }
        }
    }

}